1. Field
The following description relates to a memory device and data atomicity.
2. Description of the Related Art
A non-volatile memory is a storage device that can retain stored data even when power supply thereto is removed. Such non-volatile memory, which retains the stored data regardless of power supply, is appropriate for use storing important data files or system data.
However, when unexpected power shutdown occurs during a process of storing data in a non-volatile memory, the atomicity of data can not be guaranteed. In other words, the write process may not have been completed, leading to potential errors in the data and invalid data states. That is, if power supply is removed before a write operation is completed, the non-volatile memory retains incomplete data that neither matches the previously stored value nor the new value. Such incomplete data remains even after power is resumed and causes complications during system recovery.
In order to prevent incomplete data from being formed, a journaling or logging may be used when storing important data in a non-volatile memory. Logging is a representative technology for recovering data stored in a database. According to the logging technology, when any change occurs to data, contents before and after the change are stored in order for logs to be kept. Physically, a log is a file of updates done to the database, stored in non-volatile storage. If the database is found to be in an inconsistent state or was not previously properly shut down, the database logs can be reviewed for uncommitted transactions changes made by these transactions can be undone. Additionally, transactions that are already committed but for which changes did not yet appear in the database are redone.
However, such a scheme may increase the complexity of a software design of a system and may degrade system performance. In addition, such a scheme is available for a disk or NAND Flash read/written in sectors or block units, causing a difficulty in application to next generation non-volatile memories read/written in byte units.